import config from "./comm-web.config.js";
import AutoImport from "unplugin-auto-import/vite";
import defineConfig from "./defineConfig";
import Components from "unplugin-vue-components/vite";
import { ArcoResolver } from "unplugin-vue-components/resolvers";
import less from "./less.js";

config.css =
	{
		preprocessorOptions: { less: { modifyVars: less, javascriptEnabled: true } },
	};

var plugin = [
	Components({ resolvers: [ArcoResolver({ importStyle: "less" })] }),
	AutoImport({ include: [/\.[tj]s?$/, /\.vue$/, /\.coffee$/], imports: ["vue"] }),
];

if (process.env.NODE_ENV == "production") {
}

config.plugins = config.plugins.concat(plugin);

const host = "127.0.0.1";
const port = 54910;
console.log(`http://${host}:${port}`);

config.server = { host, port };

export default defineConfig(config);
